package homeWorkDay05;

public class text1 {
    public static void main(String[] args) {
        //创建两个线程 多态
        Thread t = new Mythread1();
        Thread t1 = new MyThread2();
        //调用start方法 不是run方法
        t.start();
        t1.start();
    }
}

class Mythread1 extends Thread {
    public void run() {
        for (int i = 0; i < 1000; i++) {
            System.out.println("hello！");
        }

    }
}

class MyThread2 extends Thread {
    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            System.out.println("word");
        }

    }
}